package cn.autumnorange.app.user.provider.service;

import cn.autumnorange.app.common.dto.ResultDto;
import cn.autumnorange.app.user.api.SysRoleService;
import cn.autumnorange.app.user.api.dto.GramtedAuthorityImpl;
import cn.autumnorange.app.user.provider.repository.SysRoleRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author wsf
 * @time 2019/6/7 21:52
 */
@Primary
@Service
public class SysRoleServiceImpl implements SysRoleService {
  @Autowired private SysRoleRepository sysRoleRepository;

  @Override
  public ResponseEntity<ResultDto<List<GramtedAuthorityImpl>>> getRolesByUserId(long userId) {
    return ResponseEntity.ok(sysRoleRepository.getRolesByUserId(userId));
  }

  @Override
  public ResultDto<List<GramtedAuthorityImpl>> getRolesById(long userId) {
    return null;
  }
}
